package com.samoiloff.util.actions {
	import flash.events.EventDispatcher;

	/**
	 * @author Damirr
	 */
	public class Action extends EventDispatcher {
		
		protected var _started	: Boolean;
		protected var _paused	: Boolean;
		
		public function Action() {
			
		}
		
		public function start():void {
			_started = true;
			dispatchEvent(new ActionEvent(ActionEvent.ACTION_START, this));
		}

		public function destroy():void {
			
		}
		
		public function pause():void {
			_paused = true;
		}

		public function unpause():void {
			_paused = false;
		}
		
		protected function finish():void {
			_started = false;
			dispatchEvent(new ActionEvent(ActionEvent.ACTION_COMPLETE, this));
		}
		
		public function cancel():void {
			_started = false;
			dispatchEvent(new ActionEvent(ActionEvent.ACTION_CANCEL, this));
		}
		
		public function get started(): Boolean {
			return _started;
		}
		
		public function get paused(): Boolean {
			return _paused;
		}
	}
}
